﻿using System;
using System.Runtime.Caching;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using nanoCMS.Core.Providers;


namespace nanoCMS.Core.Test.Providers
{
    [TestClass]
    public class CacheProvider_Test
    {
        private CacheProvider cache = CacheProvider.Default;

        [TestInitialize]
        public void TestInit()
        {
            
        }


        [TestMethod]
        public void Cache_Simple_Add_Get()
        {
            cache.Add("test", "bla");

            Assert.AreSame("bla", cache.Get("test") as string);
        }

        [TestMethod]
        public void Cache_Contains()
        {
            cache.Add("Contains", "bla");
            Assert.IsTrue(cache.Contains("Contains"));
        }

        [TestMethod]
        public void Cache_Remove()
        {
            cache.Add("Remove", "bla");
            cache.Remove("Remove");
            Assert.IsFalse(cache.Contains("Remove"));
        }

    }
}
